﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TexasHoldem
{
    public class Hand
    {
        public IEnumerable<Card> Cards { get; private set; }

        public Hand(IEnumerable<Card> cards)
        {
            if (cards == null || !cards.Any()) throw new ArgumentNullException("cards");
            this.Cards = cards.ToArray();
        }

        public static implicit operator Hand(string inlineHand)
        {
            return new HandParser().ParseHand(inlineHand);
        }

        public override string ToString()
        {
            return new HandParser().ToString(this);
        }
    }
}
